﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using Pvr_UnitySDKAPI;

public class SelectSystem : MonoBehaviour
{
    public Button m_btnProductIntroduction;
    public Button m_btnTool;
    public Button m_btnOIC;
    public Button m_btnModuleDetection;
    public Button m_btnClearObj;
    public Button m_btnAssessment;

    // Start is called before the first frame update
    void Start()
    {
        m_btnProductIntroduction = GameObject.Find("1产品介绍Btn").GetComponent<Button>();
        m_btnModuleDetection = GameObject.Find("4模块检测Btn").GetComponent<Button>();
        m_btnProductIntroduction.onClick.AddListener(()=> ButtonClick("模块一产品介绍"));
        //m_btnTool.onClick.AddListener(()=> ButtonClick("模块二工具的使用"));
        m_btnModuleDetection.onClick.AddListener(() => ButtonClick("模块四模块检测"));
    }
    void ButtonClick(string profileName)
    {
        TDuProfile.Instance.Profiles.TryGetValue(profileName,out TDuProfile.Instance.m_profile);
        SceneManager.LoadScene("product");
    }
    private void Update()
    {
        if(Controller.UPvr_GetKeyDown(1, Pvr_KeyCode.B))
        {
            Debug.Log("退出");
            SceneManager.LoadScene("Login");
        }
    }
}
